package com.IoLiu;

import java.io.*;

public class HuanChong {
    public static void main(String[] args) throws IOException {
        //字符缓冲输出流开始写数据
        BufferedOutputStream bos=new BufferedOutputStream(new
                FileOutputStream("D:\\下载\\file\\file1\\java.txt",true));
        bos.write("这里是黑马程序员基地,欢迎您!!!".getBytes());
        bos.write("\r\n".getBytes());
        bos.close();
        //字符缓冲输入流读取数据
        BufferedInputStream bis=new BufferedInputStream(new
                FileInputStream("D:\\下载\\file\\file1\\java.txt"));
//        int len;
//        while((len=bis.read())!=-1){
//
//        }
        int len;
        byte[] bys=new byte[1024];
        while((len=bis.read(bys))!=-1){
            System.out.println(new String(bys,0,len));
        }
    }
}
